import {ReactNode,lazy} from "react";

const Home = lazy(()=> import("../user/home"));
const UserDetail =lazy(() => import("../user/userDetail"));
const Userlist =lazy(() => import("../user/userlist"));
const UserHome =lazy(()=> import("../user/userHome"));

interface IRouter {
    id : number
    key ?: string
    title : string
    path : string
    exact ?: boolean
    component ?: ReactNode
    children ?:IRouter[]
}

export  const router:IRouter[] = [
    {
        id :1,
        path :"/",
        title :"index page",
        exact : true,
        component :<Home/>
    },{
        id :2,
        path :"/user",
        title :"user home",
        component :<UserHome/>,
        children : [
            {
                id :3,
                path:"/user/detail/3",
                title:"user detail 3",
                exact :true,
                component :<UserDetail/>
            },{
                id :4,
                path:"/user/detail/4",
                title:"user detail 4",
                exact :true,
                component :<UserDetail/>
            }
        ]
    }
]

